//scaffold 脚手架
//构造参数说明:

//const Scaffold({
//Key key,
//this.appBar,//标题栏
//this.body,//内容
//this.floatingActionButton,//悬浮按钮
//this.persistentFooterButtons,底部持久化现实按钮
//this.drawer,//侧滑菜单左
//this.endDrawer,//侧滑菜单右
//this.bottomNavigationBar,//底部导航
//this.backgroundColor,//背景颜色
//this.resizeToAvoidBottomPadding: true,//自动适应底部padding
//this.primary: true,试用使用primary主色
//})

//appBar  指的就是最上面 用来显示页面的状态或者信息的导航条  类似toolbar

//构造方法说明:
//AppBar({
//Key key,
//this.leading,主导Widget
//this.automaticallyImplyLeading: true,
//this.title,
//this.actions,其他附加最贱右上角
//this.flexibleSpace,//伸缩空间，显示在title上面
//this.bottom,//显示在title下面
//this.elevation: 4.0,//阴影高度
//this.backgroundColor,
//this.brightness,明暗模式
//this.iconTheme,
//this.textTheme,
//this.primary: true,是否是用primary
//this.centerTitle,//标题是否居中
//this.titleSpacing: NavigationToolbar.kMiddleSpacing,//title与leading的间隔
//this.toolbarOpacity: 1.0,//title级文字透明度
//this.bottomOpacity: 1.0,//底部文字透明度
//})

import 'package:flutter/material.dart';

class MyAppBarDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build

    return Scaffold(
      appBar: AppBar(
        leading: Icon(Icons.account_circle),
        automaticallyImplyLeading: true,
        title: Text('AppBar'),
        elevation: 10.0,
        centerTitle: true,
        backgroundColor: Colors.red,
      ),
    );
  }
}
//FloatingActionButton 参数说明:

//const FloatingActionButton({
//Key key,
//this.child,
//this.tooltip,//提示，长按按钮提示文字
//this.backgroundColor,//背景颜色
//this.heroTag: const _DefaultHeroTag(),//页面切换动画Tag
//this.elevation: 6.0,//阴影
//this.highlightElevation: 12.0,//高亮阴影
//@required this.onPressed,//点击事件
//this.mini: false//是否使用小图标
//})
class MyFloatingActionBarDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build

    return Scaffold(
      appBar: AppBar(
        leading: Icon(Icons.account_circle),
        elevation: 5.0,
        title: Text('floatingActionBar'),
        centerTitle: true,
        automaticallyImplyLeading: true,
        backgroundColor: Colors.orange,
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: null,
        child: Icon(Icons.add),
        backgroundColor: Colors.blue,
        tooltip: '你好 flutter',
      ),
    );
  }
}

//PersistentFooterButtons  底部持久化 显示按钮
class MyPersistentFooterButtonsDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build

    return Scaffold(
      appBar: AppBar(
        leading: Icon(Icons.account_circle),
        elevation: 5.0,
        title: Text('floatingActionBar'),
        centerTitle: true,
        automaticallyImplyLeading: true,
        backgroundColor: Colors.orange,
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: null,
        child: Icon(Icons.add),
        backgroundColor: Colors.blue,
        tooltip: '你好 flutter',
      ),
      persistentFooterButtons: <Widget>[
        new Icon(Icons.android),
        new Icon(Icons.book),
        new Icon(Icons.hourglass_empty),
        new Icon(Icons.headset),
        new Icon(Icons.home),
        new Icon(Icons.help)
      ],

      //这是 抽屉 界面 基本上 都
      drawer: new Drawer(
        child: new Column(
          children: <Widget>[
            new UserAccountsDrawerHeader(
                decoration: new BoxDecoration(
                    image: new DecorationImage(
                        image: new NetworkImage(
                            "http://t2.hddhhn.com/uploads/tu/201612/98/st93.png"))),
                accountName: new Text("flyou"),
                accountEmail: new Text("fangjaylong@gmail.com"),
                currentAccountPicture: new CircleAvatar(
                  //圆形头像
                  backgroundImage: new NetworkImage(
                      "http://tva2.sinaimg.cn/crop.0.3.707.707.180/a2f7c645jw8f6qvlbp1g7j20js0jrgrz.jpg"),
                )),
            new ListTile(
              leading: new Icon(Icons.refresh),
              title: new Text("刷新"),
            ),
            new ListTile(
              leading: new Icon(Icons.help),
              title: new Text("帮助"),
            ),
            new ListTile(
              leading: new Icon(Icons.chat),
              title: new Text("会话"),
            ),
            new ListTile(
              leading: new Icon(Icons.settings),
              title: new Text("设置"),
            ),
          ],
        ),
      ),
    );
  }
}
// 底部导航栏

//BottomNavigationBar金支持0-4个之间个底部按钮数量，超出4个系统将会报异常
//默认0-3个底部按钮数量时，BottomNavigationBar采用fixed的模式摆放底部按钮，当超过4个时默认使用shifting模式摆放底部按钮

//BottomNavigationBar({
//Key key,
//@required this.items,//List<BottomNavigationBarItem>
//this.onTap,//tap事件
//this.currentIndex: 0,//当前位置
//BottomNavigationBarType type,//底部item类型，fixed自适应，shifting选择放大
//this.fixedColor,选中颜色
//this.iconSize: 24.0,//图标大小
//})

// 底部导航栏的底部item

//const BottomNavigationBarItem({
//@required this.icon,
//@required this.title,
//this.backgroundColor,
//})

class MyBottomNavigationBarDemo extends StatelessWidget {

  int  tagIndex = 0;
  @override
  Widget build(BuildContext context) {
    // TODO: implement build

    return Scaffold(
      appBar: AppBar(
        leading: Icon(Icons.account_circle),
        elevation: 5.0,
        title: Text('floatingActionBar'),
        centerTitle: true,
        automaticallyImplyLeading: true,
        backgroundColor: Colors.orange,
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: null,
        child: Icon(Icons.add),
        backgroundColor: Colors.blue,
        tooltip: '你好 flutter',
      ),
      persistentFooterButtons: <Widget>[
        new Icon(Icons.android),
        new Icon(Icons.book),
        new Icon(Icons.hourglass_empty),
        new Icon(Icons.headset),
        new Icon(Icons.home),
        new Icon(Icons.help)
      ],

      //这是 抽屉 界面 基本上 都
      drawer: new Drawer(
        child: new Column(
          children: <Widget>[
            new UserAccountsDrawerHeader(
                decoration: new BoxDecoration(
                    image: new DecorationImage(
                        image: new NetworkImage(
                            "http://t2.hddhhn.com/uploads/tu/201612/98/st93.png"))),
                accountName: new Text("flyou"),
                accountEmail: new Text("fangjaylong@gmail.com"),
                currentAccountPicture: new CircleAvatar(
                  //圆形头像
                  backgroundImage: new NetworkImage(
                      "http://tva2.sinaimg.cn/crop.0.3.707.707.180/a2f7c645jw8f6qvlbp1g7j20js0jrgrz.jpg"),
                )),
            new ListTile(
              leading: new Icon(Icons.refresh),
              title: new Text("刷新"),
            ),
            new ListTile(
              leading: new Icon(Icons.help),
              title: new Text("帮助"),
            ),
            new ListTile(
              leading: new Icon(Icons.chat),
              title: new Text("会话"),
            ),
            new ListTile(
              leading: new Icon(Icons.settings),
              title: new Text("设置"),
            ),
          ],
        ),
      ),

      bottomNavigationBar: BottomNavigationBar(
        items: <BottomNavigationBarItem>[
          BottomNavigationBarItem(icon: Icon(Icons.shopping_cart), title: Text('购物车')),
          BottomNavigationBarItem(icon: Icon(Icons.message), title: Text('信息')),
          BottomNavigationBarItem(icon: Icon(Icons.person), title: Text('我的')),
        ],

        fixedColor: Colors.red,
        currentIndex: 1,  //显示的
      ),
    );
  }
}
